package controlGraph;

import java.util.ArrayList;
import java.util.Map;

public class AssignmentStatement extends Statement {
	private Expression lhs;
	private Expression rhs;
	private ArrayArith rules;
	private store zigma;

	public AssignmentStatement(Expression l, Expression r) {
		super();
		lhs = l;
		rhs = r;
	}
	
	@Override
	public void visitSuccessors(store zigma, ArrayArith rules) {
		
		this.zigma = new store(zigma);
		this.rules = new ArrayArith(rules);
		
		//workaround starts here
		Statement.zigma = this.zigma;
		Statement.rules = this.rules;
		//workaround ends here
		
		Statement.zigma.changeVariable(lhs, rhs);
		Statement.getStatement(label + 1).visitSuccessors(this.zigma, this.rules);
		/*if (isSatisfiable(axioms)) {
			ArrayList<String> succAxioms = new ArrayList<String>(axioms);
			succAxioms.add(this.toString());
			Statement.getStatement(label + 1).visitSuccessors();
		}*/
	}
	

	@Override
	public String toString() {
		return lhs + " = " + rhs;
	}
}
